<template>
	<el-dialog title="" visible :show-close="false" :modal-append-to-body="false" class="wrap"  >
		 <div class="bt">详情</div>
		<i class="el-icon-close close" @click="cancel" style="color: white;"></i>
		<el-button type="info" class="submit" @click="cancel">确定</el-button>
		<el-button type="success" class="submit" @click="edit1()">编辑</el-button>
		<el-form label-width="100px" class="form" >
			<el-form-item label="班级名称" class="select-block"  >
				  <el-input v-model="form.mc" :readonly='edit' icon="info" ></el-input>
			</el-form-item>
			<el-form-item label="老师名称" class="select-block" >
				  <el-input v-model="form.lsmc" :readonly='edit' icon="info" ></el-input>
			</el-form-item>
			<el-form-item label="行政老师" class="select-block" >
				  <el-input v-model="form.xzlsmc" :readonly='edit' icon="info" ></el-input>
			</el-form-item>
			<el-form-item label="工号" class="select-block">
				  <el-input v-model="form.gh" :readonly='edit' icon="info" ></el-input>
			</el-form-item>
			<!-- <el-form-item label="当前名称">
				  <el-input v-model="form.dqdymc" :readonly='edit' icon="info" ></el-input>
			</el-form-item> -->
			<el-form-item label="册名称" class="select-block">
				  <el-input v-model="form.cmc" :readonly='edit' icon="info" ></el-input>
			</el-form-item>
			<el-form-item label="教材名称" class="select-block">
				  <el-input v-model="form.jcmc" :readonly='edit' icon="info" ></el-input>
			</el-form-item>
			<!--<el-form-item label="学校mc">
				  <el-input v-model="form.xxmc" type="textarea" :rows="1" icon="info" ></el-input>
			</el-form-item>-->
			<el-form-item label="是否启用" class="select-block">
				  <el-input v-model="form.isqy" :readonly='edit' icon="info" ></el-input>
			</el-form-item>
			<!--<el-form-item label="创建cj/转入zr/转出zc">
				  <el-input v-model="form.lx" type="textarea" :rows="1" icon="info" ></el-input>
			</el-form-item>-->
			<el-form-item label="创建时间" class="select-block">
				  <el-input v-model="form.sj" :readonly='edit' icon="info" ></el-input>
			</el-form-item>
			<!-- <el-form-item label="助教名称">
				  <el-input v-model="form.zjmc" :readonly='edit' icon="info" ></el-input>
			</el-form-item> -->
			<el-form-item label="学生人数" class="select-block">
				  <el-input v-model="form.xs" :readonly='edit' icon="info" ></el-input>
			</el-form-item>
			<!--<el-form-item label="已排课时">
				  <el-input v-model="form.ypks" type="textarea" :rows="1" icon="info" ></el-input>
			</el-form-item>-->
			<el-form-item label="分校课程" class="select-block">
				  <el-input v-model="form.fxkcmc" :readonly='edit' icon="info" ></el-input>
			</el-form-item>
			<el-form-item label="剩余课时" class="select-block">
				  <el-input v-model="form.syks" :readonly='edit' icon="info" ></el-input>
			</el-form-item>
			<el-form-item label="开班日期" class="select-block">
				  <el-input v-model="form.kbrq" :readonly='edit' icon="info" ></el-input>
			</el-form-item>
		</el-form>

	</el-dialog>
</template>

<script type="text/javascript">
	import qs from 'qs'
	export default {
		props: ['params'],
		data() {
			return {
				form: {
					mc :'',
					lsmc :'',
					gh :'',
					dqdymc :'',
					cmc :'',
					jcmc :'',
					xxmc :'',
					isqy :'',
					lx :'',
					sj :'',
					zjmc :'',
					xs :'',
					ypks :'',
					fxkcmc :'',
					syks :'',
					kbrq :'',
					id: ''
				},
				edit:true,
			}
		},
		created() {
     	this.form.id=this.params.row.id;
			this.loadinfo();
		},
		methods: {
			edit1(){
				this.edit=true
			},
			loadinfo(){
				 var logininfo = JSON.parse(localStorage.logininfo) ;
				 this.axios.get(this.$store.state.api+'bj/info',{
						 params:{
							 xxid:logininfo.xxid,
							 yhid:logininfo.id,
							 id:this.form.id
						 }
					}).then( res =>  {
							this.form=res.data.data
					 }).catch(res => {
						 this.$message.warning("服务器异常");
			 				this.$emit('close', { type: 'info', cancel: true });
					 })
			},
			cancel() {
				this.$emit('close', { type: 'info', cancel: true })
			}
		}
	}
</script>

<style lang="less" scoped>
	.wrap {
		color: white;
		text-align: right;
	}
	.bt{
		position: absolute;
		width: 100%;
		height: 50px;
		margin: 0 auto;
		top: 0;
		left: 0;
		background: #50BFFF;
		margin-bottom: 20px;
		color:white;
		text-align:left;
		line-height: 50px;
		font-size: 17px;
		padding-left: 15px;
	}
	.close{
			z-index: 10;
			position: absolute;
	}
	.form {
		text-align: left;
	margin-top: 20px;
	}
	 .input {
            width: 300px;
            display: inline-block;
        }

	.select-block {
		width: 45%;
		float: left;
		// display: block;
	}
	.submit {
		width: 120px;
		margin-top: 20px;
	}
</style>
